# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=docbook-xsl

pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.78.1
pkgrel=2
pkgdesc='XML stylesheets for Docbook-xml transformations (mingw-w64)'
arch=('any')
license=('custom')
url='http://docbook.sourceforge.net/'
depends=("${MINGW_PACKAGE_PREFIX}-libxml2" "${MINGW_PACKAGE_PREFIX}-libxslt" "${MINGW_PACKAGE_PREFIX}-docbook-xml")
case $MINGW_CHOST in
  i686*)
    install=${_realname}32.install
  ;;
  x86_64*)
    install=${_realname}64.install
  ;;
esac
source=("http://downloads.sourceforge.net/docbook/${_realname}-${pkgver}.tar.bz2")
md5sums=('6dd0f89131cc35bf4f2ed105a1c17771')

package() {
  cd ${srcdir}/${_realname}-${pkgver}

  _pkgroot=${pkgdir}${MINGW_PREFIX}/share/xml/docbook/xsl-stylesheets-${pkgver}

    install -dm755 ${_pkgroot}
  install -m644 VERSION VERSION.xsl ${_pkgroot}

  for fn in assembly common eclipse epub epub3 fo highlighting html htmlhelp javahelp lib \
                  manpages params profiling roundtrip template website xhtml xhtml-1_1 xhtml5; do
    install -dm755 ${_pkgroot}/${fn}
    install -m644 ${fn}/*.{xml,xsl,dtd,ent} ${_pkgroot}/${fn} || true  # ignore missing files
  done

  install -Dm644 catalog.xml ${_pkgroot}/catalog.xml
  install -dm755 ${pkgdir}${MINGW_PREFIX}/etc/xml
  install -Dm644 COPYING ${pkgdir}${MINGW_PREFIX}/share/licenses/${pkgname}/LICENSE

}
